//go:build ignore
// +build ignore

package main

import (
	"fmt"

	"github.com/yourusername/gox"
)

func TestNewGoxSyntax() {
	// 测试1: 基础 gox.Sql 语法
	query1 := gox.Sql(`SELECT * FROM users WHERE active = 1`)

	// 测试2: 参数化查询
	id := 123
	query2 := gox.Sql(`SELECT * FROM t_data_brain_report_info WHERE id = #{id}`)

	// 测试3: 文本插入
	tableName := "t_users"
	query3 := gox.Sql(`SELECT count(*) FROM {tableName}`)

	// 测试4: ${} 嵌套语法 - 你建议的新语法
	status := "active"
	query4 := gox.Sql(`
		SELECT * FROM t_data_brain_report_info WHERE id = #{id}
		WHERE 1 = 1 
		{
			if id > 0 {
				${ AND id > #{id} }
			}
		}
	`)

	// 测试5: 复杂的 ${} 嵌套
	includeDeleted := false
	query5 := gox.Sql(`
		SELECT * FROM users
		WHERE status = #{status}
		{
			if !includeDeleted {
				${ AND deleted_at IS NULL }
			} else {
				${ AND 1=1 }
			}
		}
	`)

	fmt.Println("Query 1:", query1.String())
	fmt.Println("Query 2:", query2.String())
	fmt.Println("Query 3:", query3.String())
	fmt.Println("Query 4:", query4.String())
	fmt.Println("Query 5:", query5.String())
}

func main() {
	TestNewGoxSyntax()
}
